/* This is a generated file. Don't edit. Edit the source instead.
 */

#ifndef _sp_cmd_h_
#define _sp_cmd_h_

#include <inttypes.h>

typedef struct sp sp_t;
struct sp
{
    int fd;
    struct evbuffer *input;
    struct evbuffer *output;
    void *user_data;

    int (*cb_hub_redirect)(sp_t *sp, const char *hub_address, const char *new_address);
    int (*cb_user_update)(sp_t *sp, const char *hub_address, const char *nick, const char *description, const char *tag, const char *speed, const char *email, uint64_t share_size, int is_operator, unsigned int extra_slots);
    int (*cb_public_message)(sp_t *sp, const char *hub_address, const char *nick, const char *message);
    int (*cb_server_version)(sp_t *sp, const char *version);
    int (*cb_connect_failed)(sp_t *sp, const char *hub_address);
    int (*cb_queue_remove_filelist)(sp_t *sp, const char *nick);
    int (*cb_port)(sp_t *sp, int port);
    int (*cb_transfer_aborted)(sp_t *sp, const char *local_filename);
    int (*cb_filelist_finished)(sp_t *sp, const char *hub_address, const char *nick, const char *filename);
    int (*cb_download_starting)(sp_t *sp, const char *hub_address, const char *nick, const char *remote_filename, const char *local_filename, uint64_t filesize);
    int (*cb_upload_starting)(sp_t *sp, const char *hub_address, const char *nick, const char *local_filename, uint64_t filesize);
    int (*cb_transfer_stats)(sp_t *sp, const char *local_filename, uint64_t offset, uint64_t filesize, unsigned int bytes_per_sec);
    int (*cb_private_message)(sp_t *sp, const char *hub_address, const char *my_nick, const char *remote_nick, const char *remote_display_nick, const char *message);
    int (*cb_queue_add_filelist)(sp_t *sp, const char *nick, unsigned int priority);
    int (*cb_hub_disconnected)(sp_t *sp, const char *hub_address);
    int (*cb_queue_add_target)(sp_t *sp, const char *local_filename, uint64_t size, const char *tth, unsigned int priority);
    int (*cb_queue_remove_target)(sp_t *sp, const char *local_filename);
    int (*cb_connection_closed)(sp_t *sp, const char *nick, int direction);
    int (*cb_queue_add_directory)(sp_t *sp, const char *target_directory, const char *nick);
    int (*cb_download_finished)(sp_t *sp, const char *local_filename);
    int (*cb_upload_finished)(sp_t *sp, const char *local_filename);
    int (*cb_init_completion)(sp_t *sp, int level);
    int (*cb_set_priority)(sp_t *sp, const char *target_filename, unsigned int priority);
    int (*cb_queue_remove_directory)(sp_t *sp, const char *target_directory);
    int (*cb_status_message)(sp_t *sp, const char *hub_address, const char *message);
    int (*cb_user_command)(sp_t *sp, const char *hub_address, int type, int context, const char *description, const char *command);
    int (*cb_queue_add_source)(sp_t *sp, const char *local_filename, const char *nick, const char *remote_filename);
    int (*cb_queue_remove_source)(sp_t *sp, const char *local_filename, const char *nick);
    int (*cb_hubname)(sp_t *sp, const char *hub_address, const char *new_name);
    int (*cb_search_response)(sp_t *sp, int id, const char *hub_address, const char *nick, const char *filename, int filetype, uint64_t size, int openslots, int totalslots, const char *tth, const char *speed);
    int (*cb_share_stats)(sp_t *sp, const char *path, uint64_t size, uint64_t totsize, uint64_t dupsize, unsigned int nfiles, unsigned int ntotfiles, unsigned int nduplicates);
    int (*cb_user_login)(sp_t *sp, const char *hub_address, const char *nick, const char *description, const char *tag, const char *speed, const char *email, uint64_t share_size, int is_operator, unsigned int extra_slots);
    int (*cb_directory_finished)(sp_t *sp, const char *target_directory);
    int (*cb_user_logout)(sp_t *sp, const char *hub_address, const char *nick);
    int (*cb_stored_filelists)(sp_t *sp, const char *nicks);
    int (*cb_get_password)(sp_t *sp, const char *hub_address, const char *nick);
    int (*cb_hub_add)(sp_t *sp, const char *hub_address, const char *hub_name, const char *nick, const char *description, const char *encoding);
};

sp_t *sp_init(void);

int sp_dispatch_command(const char *line, const char *delimiters,
        int allow_null_elements, sp_t *sp);
#endif
